# Maintainer: David Runge <dvzrv@archlinux.org>

_name=nkdfu
pkgname=python-nkdfu
pkgver=0.2
pkgrel=2
pkgdesc="Python tool for Nitrokeys' firmware update"
arch=(any)
url="https://github.com/Nitrokey/nkdfu"
license=(GPL2)
depends=(python-fire python-tqdm python-intelhex python-libusb1)
makedepends=(python-build python-flit-core python-installer python-wheel)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
sha256sums=('f25f75ddd382c47285b6943cde9f51577b1496ed284f93d58b5e054ae609f5f8')
b2sums=('8251d54f02d7fa114a00037409cbc35fd0991d45465351dd3247c70d52aa299e260bacca69aa7e8958b9b50996141ee589c3c663c84523ff7488911ee0e3b9b3')

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}
